<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./bootstrap/bootstrap.min.css" />
    <link rel="stylesheet" href="./bootstrap/bootstrap-icons.css" />

</html>

<head>
    <title>注册登录页面</title>
    <style>
        body {
            width: 100%;
            height: 100vh;
            margin: 0;
            padding: 0;
            background-image: url('./image/background.jpg');
            background-repeat: no-repeat;
            background-position: center center;
            background-size: cover;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            width: 300px;
            margin: 0 auto;
            padding: 20px;
            border-radius: 5px;
            background-position: center center;
            border: 2px solid #000;
            border-radius: 5px;
            background-color: #9dc3f5;

        }

        .form-group {
            margin-bottom: 10px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
        }

        .form-group input {
            width: 100%;
            padding: 5px;
        }

        .form-group-login {
            margin-bottom: 10px;
            text-align: center;
        }

        .form-group-login button {
            margin-top: 10px;
            display: inline-block;
        }

        .my-toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 999;
        }
    </style>

</head>

<body>
    <div class="container">
        <h1 id="text" style="text-align: center;">登录页面</h1>

        <!-- 登录表单 -->
        <form id="login-form" class="login-form">
            <div class="form-group">
                <label for="login-username">用户名：</label>
                <input type="text" id="login-username" name="login-username">
            </div>

            <div class="form-group">
                <label for="login-password">密码：</label>
                <input type="password" id="login-password" name="login-password">
            </div>

            <div class="form-group-login">
                <button type="button" onclick="login()">登录</button>
                <button type="button" onclick="switchToRegister()">注册</button>
                <button id="visitor" type="button" onclick="visitor()">游客登录</button>
            </div>
        </form>

        <!-- 注册表单 -->
        <form id="register-form" class="register-form" style="display: none;">
            <div class="form-group">
                <label for="register-username">用户名：</label>
                <input type="text" id="register-username" name="register-username">
            </div>

            <div class="form-group">
                <label for="register-password">密码：</label>
                <input type="password" id="register-password" name="register-password">
            </div>

            <div class="form-group-login">
                <button type="button" onclick="register()">注册</button>
                <button type="button" onclick="switchToLogin()">返回登录</button>
            </div>
        </form>
    </div>
    <div class="my-toast" data-bs-delay="1500" aria-live="assertive" aria-atomic="true" role="alert">
        <div class="toast-body">提示消息</div>
    </div>
</body>
<script src="./bootstrap/bootstrap.min.js"></script>
<script src="./lib/form-serialize.js"></script>
<script src="./lib/axios.js"></script>
<script src="./sc/common.js"></script>
<script src="./sc/script.js"></script>
<script src="./sc/login.js"></script>
<script src="./sc/register.js"></script>

</html>